.addresses-container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.addresses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.addresses-header h2 {
    color: #333;
    font-size: 24px;
}

.add-address-button {
    color: black;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.address-list table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.address-list th,
.address-list td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

.address-list th:nth-child(1),
.address-list td:nth-child(1) {
    width: 10%;
}

.address-list th:nth-child(2),
.address-list td:nth-child(2) {
    width: 15%;
}

.address-list th:nth-child(3),
.address-list td:nth-child(3) {
    width: 20%;
}

.address-list th:nth-child(4),
.address-list td:nth-child(4) {
    width: 30%;
    white-space: nowrap;
}

.address-list th:nth-child(5),
.address-list td:nth-child(5) {
    width: 15%;
    white-space: nowrap;
}

.address-list th:nth-child(6),
.address-list td:nth-child(6) {
    width: 10%;
    white-space: nowrap;
}

.address-list th {
    background-color: #f2f2f2;
    font-weight: bold;
    color: #333;
}

.address-list tbody tr:hover {
    background-color: #f9f9f9;
}

.action-btn {
    padding: 5px 10px;
    margin-right: 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.edit-btn {
    /* background-color: #2196F3;
    color: white; */
    background-color: white
}

.delete-btn {
    /* background-color: #f44336;
    color: white; */
    background-color: white
}

.move-top-btn {
    background-color: #ff9800;
    color: white;
}

.move-top-btn:hover {
    background-color: #f57c00;
}

.default-address {
    background-color: rgb(255,214,204);
    color: rgb(255,80,106);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.set-default-btn {
    padding: 5px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.set-default-btn:hover {
    background-color: #007bff;
    color: white;
}

@media (max-width: 768px) {
    .addresses-container {
        padding: 10px;
    }

    .address-list th,
    .address-list td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .add-address-button {
        padding: 8px 10px;
        font-size: 14px;
    }

    .action-btn, .set-default-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
} 

/* 新建地址模态框样式 */
.modal {
    display: none; /*默认隐藏*/
    position: fixed; /* 固定位置 */
    z-index: 1000; /* 确保在最上层 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* 允许滚动 */
    background-color: rgba(0,0,0,0.5); /* 半透明黑色背景 */
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px; /* 最大宽度 */
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    animation-name: animatetop;
    animation-duration: 0.4s
}

/* 模态框动画 */
@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    border-bottom: none;
    padding-bottom: 0;
}

.modal-body {
    padding-top: 10px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

.address-selects {
    display: flex;
    gap: 10px;
}

.address-selects select {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    appearance: none; /* Remove default arrow */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.362%22%20height%3D%22292.362%22%3E%3Cpath%20fill%3D%22%23007bff%22%20d%3D%22M287.9%20139.4L156.6%20.1c-4.2-3.7-10.6-3.7-14.8%200l-131.3%20139.3c-4.4%204.7-4.4%2012.4%200%2017.1l131.3%20139.3c4.2%203.7%2010.6%203.7%2014.8%200l131.3-139.3c4.4-4.7%204.4-12.4%200-17.1z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 12px auto;
}

.address-selects select:disabled {
    background-color: #f8f8f8;
    cursor: not-allowed;
}

.form-group input[type="text"],
.form-group textarea {
    width: calc(100% - 24px); /* Adjust for padding and border */
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff5000;
    box-shadow: 0 0 5px rgba(255, 80, 0, 0.3);
}

.required {
    color: red;
    margin-right: 5px;
}

.delivery-location {
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #555;
}

.delivery-location .location {
    font-weight: bold;
    margin: 0 10px;
}

.delivery-location .change-location {
    color: #007bff;
    text-decoration: none;
}

.phone-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.phone-group label {
     margin-bottom: 0;
}

.phone-group select {
    width: auto;
    padding-right: 30px; /* Space for arrow */
}

.phone-group input[type="text"] {
    flex-grow: 1;
    width: auto;
}

.form-actions {
    text-align: center;
    margin-top: 20px;
}

.save-address-btn {
    background-color: #ff5000;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 40px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.save-address-btn:hover {
    background-color: #e54500;
} 


/* 弹窗居中样式 */
#deleteConfirmModal.modal {
    display: none;
    position: fixed;
    left: 0; top: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.15);
    justify-content: center;
    align-items: center;
}
#deleteConfirmModal .modal-content {
    width: 260px !important;
    min-width: 0;
    max-width: 90vw;
    padding: 18px 18px 16px 18px !important;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
#deleteConfirmModal .modal-body {
    padding: 0 !important;
}
#deleteConfirmModal .modal-body > div:first-child {
    font-size: 15px;
    margin-bottom: 1.2rem;
    color: #333;
}
#deleteConfirmModal .close {
    font-size: 22px;
    top: 10px;
    right: 14px;
    position: absolute;
}
#deleteConfirmModal .modal-body > div:last-child {
    gap: 0.7rem !important;
}
#deleteConfirmModal button {
    padding: 0.5rem 0 !important;
    font-size: 15px !important;
    border-radius: 6px !important;
}
#deleteConfirmModal[style*="display: block"] {
    display: flex !important;
} 